﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Globalization;
using System.Web.Security;

namespace RIS.TMP.WEB.APP.Models
{
    [Table("CAddCar")]
    public class CAddCar
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public int AddCarId { get; set; }
        [ForeignKey("CFBranch")]
        public Nullable<int> AddCarUnit { get; set; }
        public string AddCarNo { get; set; }
        public string AddCarlicence { get; set; }
        [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
        [DataType(DataType.Date)]
        public DateTime? AddCarRegDate { get; set; }
        public string CarNoProperty { get; set; }
        public string CarBrand { get; set; }
        [ForeignKey("CModelCar")]
        public Nullable<int> CarModel { get; set; }
        [ForeignKey("CStageCar")]
        public Nullable<int> CarType { get; set; }
        public string MachineNo { get; set; }
        public string ChassisNo { get; set; }
        public string CarPistons { get; set; }
        public string CarPower { get; set; }
        public string WheelAxle { get; set; }
        public string FreightWeight { get; set; }
        public string CarWeight { get; set; }
        [ForeignKey("CRoueSize")]
        public Nullable<int> RoueSize { get; set; }
        public string CarProject { get; set; }
        [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
        [DataType(DataType.Date)]
        public DateTime? StartCon { get; set; }
        [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
        [DataType(DataType.Date)]
        public DateTime? EndCon { get; set; }
        public string AddCarYear { get; set; }
        [ForeignKey("CStatusRepair")]
        public Nullable<int> AddCarStatus { get; set; }
        public string Pic { get; set; }
        public string Remarks { get; set; }
        [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
        [DataType(DataType.Date)]
        public DateTime? ExireContract { get; set; }
        public string RecordStatus { get; set; }
        public string CreateBy { get; set; }
        public Nullable<System.DateTime> CreateWhen { get; set; }
        public string UpdateBy { get; set; }
        public Nullable<System.DateTime> UpdateWhen { get; set; }

        public virtual CModelCar CModelCar { get; set; }
        public virtual CRoueSize CRoueSize { get; set; }
        public virtual CStatusRepair CStatusRepair { get; set; }
        public virtual CStageCar CStageCar { get; set; }
        public virtual CFBranch CFBranch { get; set; }
    }
}